package com.xsr.mapper;

import com.xsr.pojo.SysUsers;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

/**
 * @author 邢式瑞
 * @version 1.0
 * @project springMvcday03
 * @date 2022/9/14 17:52
 */
public interface UserMapper {
    @Select("select perms from sys_menu where id in (select s. m_id  from sys_role_menu as s inner join sys_user_role as u on u.r_id=s.r_id where u.u_id=#{id} ) ")
    List<String> selectPrem(int id);
 @Select("select  name from sys_role where id in (select s. r_id  from sys_role_menu as s inner join sys_user_role as u on u.r_id=s.r_id where u.u_id=#{id}) ")
 List<String> selectRoles(int id);
 @Select("select * from sys_users where username=#{username} and password=#{password}")
    SysUsers selectUserAndName(String username, String password);
@Select("select * from sys_users where username=#{username}")
    SysUsers selectUsername(String username);
@Select("select name feom sys_users")
    List<String> selectAll();
}
